package study.javabasic.communication.SynCommunication;

/**
 * Created by zhangshuhan on 2019/3/18.
 */
public class ThreadB implements Runnable {

    Object lock=new Object();

    public ThreadB(Object o) {
        this.lock = o;
    }


    @Override
    public void run() {
        synchronized (lock){
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            System.out.println("ThreadB do something");
        }

    }
}
